package com.fqgj.xjd.user.dao.impl;
import com.fqgj.common.base.AbstractBaseMapper;
import com.fqgj.xjd.user.dao.UserAuthZhimaDao;
import com.fqgj.xjd.user.entity.UserAuthZhimaEntity;
import com.google.common.collect.Maps;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
* User: zhangxingyun
* Date: 2017-07-20
* Time: 18:38:53.017
*/

@Repository
public class UserAuthZhimaDaoImpl extends AbstractBaseMapper<UserAuthZhimaEntity> implements UserAuthZhimaDao {

    @Override
    public int deleteByUserCode(String userCode) {
        return getSqlSession().delete(getStatement("deleteByUserCode"), userCode);
    }

    @Override
    public UserAuthZhimaEntity selectUserAuthZhimaByUserCode(String userCode) {
        return getSqlSession().selectOne(getStatement("selectUserAuthZhimaByUserCode"), userCode);
    }
    @Override
    public UserAuthZhimaEntity selectUserAuthZhimaWithDeletedByUserCode(String userCode) {
        return getSqlSession().selectOne(getStatement("selectUserAuthZhimaWithDeletedByUserCode"), userCode);
    }

    @Override
    public List<UserAuthZhimaEntity> selectUserAuthZhimaListByPage(Integer startIndex ,Integer pageSize){
        Map<String,Integer> params = Maps.newHashMap();
        params.put("startIndex",startIndex);
        params.put("pageSize",pageSize);
        return getSqlSession().selectList(getStatement("selectUserAuthZhimaListByPage"),params);
    }


}